﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Data.SqlClient;

using JM.JCY.BusinessEntity;
using JM.JCY.Common;
using System.Data;
namespace JM.JCY.DataAccess
{
    public class NewsDA : JCYDataAccessBasecs
    {
        public NewsDataSet.T_AnnouncementDataTable GetNews(string subject, string category, string status, DateTime? startDate, DateTime? endDate)
        {
            NewsDataSet.T_AnnouncementDataTable dt = new NewsDataSet.T_AnnouncementDataTable();
            base.Helper.Fill(dt, "P_Announcement_S_General", subject, category, status, startDate, endDate);
            return dt;
        }

        public NewsDataSet.T_AnnouncementDataTable GetNewsById(int newsId)
        {
            NewsDataSet.T_AnnouncementDataTable dt = new NewsDataSet.T_AnnouncementDataTable();
            base.Helper.Fill(dt, "P_Announcement_S_byId", newsId);
            return dt;
        }

        public NewsDataSet.T_NewsDataTable GetNewsForHome(string category, int count)
        {
            NewsDataSet.T_NewsDataTable dt = new NewsDataSet.T_NewsDataTable();
            base.Helper.Fill(dt, "P_Announcement_S_byCount", category, count);
            return dt;
        }

        public void UpdateNews(NewsDataSet.T_AnnouncementDataTable dt)
        {
            Helper.Update(dt);
        }

        public NewsDataSet.T_AnnouncementDataTable GetSpeechForHome(int count)
        {
            NewsDataSet.T_AnnouncementDataTable dt = new NewsDataSet.T_AnnouncementDataTable();
            base.Helper.Fill(dt, "P_Speech_S_ForHome", count);
            return dt;
        }

    }
}
